
using System.Collections.Generic;

public enum WuXing
{
    木 = 1,
    火 = 2,
    土 = 3,
    金 = 4,
    水 = 5,
}
public enum BaGua
{
    乾 = 1,
    兑 = 2,
    离 = 3,
    震 = 4,
    巽 = 5,
    坎 = 6,
    艮 = 7,
    坤 = 8
}

public enum ShengKe
{
    用克体,
    体克用,
    体生用,
    用生体,
    体用五行相同
}

public enum JiXiong
{
    大吉,
    小吉,
    大凶,
    小凶,
}


public class Data
{
    public static Dictionary<BaGua, WuXing> BaGua2WuXing = new Dictionary<BaGua, WuXing>()
    {
        {BaGua.乾,WuXing.金},
        {BaGua.兑,WuXing.金},
        {BaGua.离,WuXing.火},
        {BaGua.震,WuXing.木},
        {BaGua.巽,WuXing.木},
        {BaGua.坎,WuXing.水},
        {BaGua.艮,WuXing.土},
        {BaGua.坤,WuXing.土},
    };
    public static Dictionary<BaGua, string> BaGua2ZiRan = new Dictionary<BaGua, string>()
    {
        {BaGua.乾,"天"},
        {BaGua.兑,"泽"},
        {BaGua.离,"火"},
        {BaGua.震,"雷"},
        {BaGua.巽,"风"},
        {BaGua.坎,"水"},
        {BaGua.艮,"山"},
        {BaGua.坤,"地"},
    };
    
    public static Dictionary<ShengKe, JiXiong> shengKe2JiXiong = new Dictionary<ShengKe, JiXiong>()
    {
        {ShengKe.用克体,JiXiong.大凶},
        {ShengKe.体克用,JiXiong.小吉},
        {ShengKe.体生用,JiXiong.小凶},
        {ShengKe.用生体,JiXiong.大吉},
        {ShengKe.体用五行相同,JiXiong.大吉}
    };

    public static ShengKe GetShengKe(WuXing ti, WuXing yong)
    {
        if (ti == WuXing.木)
        {
            if (yong == WuXing.火) return ShengKe.体生用;
            if (yong == WuXing.土) return ShengKe.体克用;
            if (yong == WuXing.金) return ShengKe.用克体;
            if (yong == WuXing.水) return ShengKe.用生体;
            if (yong == WuXing.木) return ShengKe.体用五行相同;
        }
        else if (ti == WuXing.火)
        {
            if (yong == WuXing.土) return ShengKe.体生用;
            if (yong == WuXing.金) return ShengKe.体克用;
            if (yong == WuXing.水) return ShengKe.用克体;
            if (yong == WuXing.木) return ShengKe.用生体;
            if (yong == WuXing.火) return ShengKe.体用五行相同;
        } 
        else if (ti == WuXing.土)
        {
            if (yong == WuXing.金) return ShengKe.体生用;
            if (yong == WuXing.水) return ShengKe.体克用;
            if (yong == WuXing.木) return ShengKe.用克体;
            if (yong == WuXing.火) return ShengKe.用生体;
            if (yong == WuXing.土) return ShengKe.体用五行相同;
        }
        else if (ti == WuXing.金)
        {
            if (yong == WuXing.水) return ShengKe.体生用;
            if (yong == WuXing.木) return ShengKe.体克用;
            if (yong == WuXing.火) return ShengKe.用克体;
            if (yong == WuXing.土) return ShengKe.用生体;
            if (yong == WuXing.金) return ShengKe.体用五行相同;
        }
        else if (ti == WuXing.水)
        {
            if (yong == WuXing.木) return ShengKe.体生用;
            if (yong == WuXing.火) return ShengKe.体克用;
            if (yong == WuXing.土) return ShengKe.用克体;
            if (yong == WuXing.金) return ShengKe.用生体;
            if (yong == WuXing.水) return ShengKe.体用五行相同;
        }
        
        return ShengKe.体克用;
    }
}

public enum Gua64
{ 
    乾 = 1,
    坤 = 2,
    屯 = 3,
    蒙 = 4,
    需 = 5,
    讼 = 6,
    师 = 7,
    比 = 8,
    小畜 = 9,
    履 = 10,
    泰 = 11,
    否 = 12, 
    同人 = 13,
    大有 = 14,
    谦 = 15,
    豫 = 16,
    随 = 17,
    蛊 = 18,
    临 = 19,
    观 = 20,
    噬嗑 = 21,
    贲 = 22,
    剥 = 23,
    复 = 24,
    无妄 = 25,
    大畜 = 26,
    颐 = 27,
    大过 = 28,
    坎 = 29,
    离 = 30,
    咸 = 31,
    恒 = 32,
    遁 = 33,
    大壮 = 34,
    晋 = 35,
    明夷 = 36,
    家人 = 37,
    睽 = 38,
    蹇 = 39,
    解 = 40,
    损 = 41,
    益 = 42,
    夬 = 43,
    姤 = 44,
    萃 = 45,
    升 = 46,
    困 = 47,
    井 = 48,
    革 = 49,
    鼎 = 50,
    震 = 51,
    艮 = 52,
    渐 = 53,
    归妹 = 54,
    丰 = 55,
    旅 = 56,
    巽 = 57,
    兑 = 58,
    涣 = 59,
    节 = 60,
    中孚 = 61,
    小过 = 62,
    既济 = 63,
    未济 = 64
}